package com.kjlink.internal.workreport.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 描述:
 * 一些通用的参数
 *
 * @author Vic.xu
 * @since 2024-12-03 9:20
 */
@Configuration
public class CommonProperties {

    private static final Logger LOGGER = LoggerFactory.getLogger(CommonProperties.class);

    /**
     * 工银jira前缀
     */
    @Value("${stl.jira.prefix:ICBCSTL}")
    private String jiraPrefix;

    /**
     * oa登录地址
     */
    @Value("${stl.login.url:}")
    private String loginUrl;

    /**
     * 旧版本是否还启用
     */
    @Value("${stl.enable.old:false}")
    private boolean enableOld;

    public String getJiraPrefix() {
        return jiraPrefix;
    }

    public void setJiraPrefix(String jiraPrefix) {
        this.jiraPrefix = jiraPrefix;
    }

    public void setLoginUrl(String loginUrl) {
        this.loginUrl = loginUrl;
    }

    public String getLoginUrl() {
        return loginUrl;
    }

    public boolean isEnableOld() {
        return enableOld;
    }

    public void setEnableOld(boolean enableOld) {
        this.enableOld = enableOld;
    }

    @PostConstruct
    private void init() {
        LOGGER.info("init CommonProperties:\n\t{}", this.toString());
    }

    @Override
    public String toString() {
        return "CommonProperties{" +
                "jiraPrefix='" + jiraPrefix + '\'' +
                ", loginUrl='" + loginUrl + '\'' +
                ", enableOld=" + enableOld +
                '}';
    }
}
